package com.nettyRpc.consumer;

import com.nettyRpc.api.IHelloService;
import com.nettyRpc.consumer.netty.NettyClient;
import io.netty.channel.Channel;

/**
 * @Description serial _ netty _event
 * @Author xsd
 * @Date 2020/6/15 22:44
 * zj: Bootstrap 绑定 EventLoopGroup 监听 SocketChannel__ChannelPipeline
 *      SimpleChannelInboundHandler<DubboResult> 1、获取通道 channelActive
 *      写数据 channel.writeAndFlush(request)  2、接收响应 channelRead0
 */
public class consumerTest {
    public static void main(String[] args) {
        Channel channel = new NettyClient().doOpen("127.0.0.1", 8088);
        IHelloService helloService = new DubboProxy().client(IHelloService.class, channel);
        //代理对象 -通道、发送数据
        System.out.println(helloService.hello("Hello World"));
    }
}
